package com.surpassun.emall.repository;

import java.util.List;

import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import com.surpassun.emall.model.StoreType;

/**
 *
 * @author Denis
 */
@Repository
public class StoreTypeRepository extends AbstractRepository<StoreType> {
	
	private final String QUERY_GET_ROOT_TYPES = "StoreType_GetRootTypes";

    public StoreTypeRepository() {
        super(StoreType.class);
    }

	@SuppressWarnings("unchecked")
	public List<StoreType> getRootTypes() {
		Query query = super.getEntityManager().createNamedQuery(QUERY_GET_ROOT_TYPES);
    	return (List<StoreType>)query.getResultList();
	}
}